<?php
$Tema="default";
if(isset($_GET['modulo'])) $modulo=htmlentities($_GET['modulo']); else $modulo='inicio';
if(ini_get('register_globals')) echo 'Peligro, "Register Global" Activo';
include('software-wmb.php');
include('lenguajes/ES-MX.php');
include('funciones-wmb.php');
include('config-wmb.php');
include('autenticar-wmb.php');
if(!defined('_SetYour_')){
	header("Location: index.php");
	die("Error");
}
if($modulos=$SQL->consulta("SELECT * FROM set_modulos")){
	foreach($modulos as $v){
		if($v->con_menu==true) $menu[] = $v;
		if($v->nombre===$modulo) $mod=$v->dir.'/'.$v->source;	
	}
}else{
	echo "Error en SQL de modulos";
}
if(!$menu) die('Error Table Not found');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title><?=$S['nombre']." ".$S['version'];?></title>
<link href="<?="temas/$Tema/estilos/"?>admin-wmb.css" type="text/css" rel="stylesheet" rev="stylesheet" />
<script type="text/javascript" src="scripts/fecha.js"></script>
<script type="text/javascript" src="scripts/ajax.js"></script>
</head>
<body style="font:normal 12px Arial, Helvetica, sans-serif; text-align:center">
<center>
    <div class="div-top">
    <div id="titulo">
	<?=$_P['welcome'];?>
	 <b><u><?=($GLOBALS['U']->nombre)?></u></b>
	<?="$_P[al] $_P[cpanel]"?> 
	<b><u><?=$S['nombre']." ".$S['version'];?></u></b></div id="titulo">
    <div id="fecha"><script type="text/javascript">fecha();</script> <a href="?logout"><img src="<?="temas/$Tema/imagenes/"?>logout.png" border="0" /></a></div>
        <div id="menu">
        <?php
        foreach($menu as $v){
        	echo "<div class=\"item\"><a href=\"?modulo=".htmlentities($v->nombre)."\" class=\"menu-h\" title='".htmlentities($v->descripcion)."'>".htmlentities($v->menu)."</a></div>";
        }
        ?>
        </div>
    </div>
<div class="div-midle">
<div id="include">
<? if(!@include("modulos/$mod")) echo $_P['RR_MOD']; //ENTRADA DE MODULOS ?>
</div>
</div>
<div class="div-bottom"></div>
</center>
<script type="text/javascript">
var include = document.getElementById('include');
var menu = document.getElementById('menu');
if(include.clientHeight>menu.clientHeight)menu.style.height=(include.clientHeight)+'px';
</script>
</body>
</html>

